﻿using System;
using System.Management;

namespace MonkeyGetProfile
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("ComputerModel:" + GetComputerModel());
            Console.WriteLine("CpuId:" + GetCpuId());
            Console.WriteLine("VolumeSerial:" + GetVolumeSerial());
            Console.ReadLine();
        }

        private static string GetComputerModel()
        {
            var s1 = new ManagementObjectSearcher("select * from Win32_ComputerSystem");
            foreach (ManagementObject oReturn in s1.Get())
            {
                return oReturn["Model"].ToString().Trim();
            }
            return string.Empty;
        }

        private static string GetCpuId()
        {
            var managClass = new ManagementClass("win32_processor");
            var managCollec = managClass.GetInstances();

            foreach (ManagementObject managObj in managCollec)
            {
                //Get only the first CPU's ID
                return managObj.Properties["processorID"].Value.ToString();
            }
            return string.Empty;
        }

        private static string GetVolumeSerial()
        {
            var disk = new ManagementObject(@"win32_logicaldisk.deviceid=""c:""");
            disk.Get();

            var volumeSerial = disk["VolumeSerialNumber"].ToString();
            disk.Dispose();

            return volumeSerial;
        }
    }
}
